package com.sky.edumanageapi.teacher.service.impl;

import com.sky.edumanageapi.teacher.dao.repository.TeacherRepository;
import com.sky.edumanageapi.teacher.mapper.TeacherMapper;
import com.sky.edumanageapi.teacher.pojo.dto.TeacherParam;
import com.sky.edumanageapi.teacher.pojo.dto.TeacherQuery;
import com.sky.edumanageapi.teacher.pojo.vo.TeacherVO;
import com.sky.edumanageapi.teacher.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    TeacherMapper teacherMapper;

    @Override
    public List<TeacherVO> selectTeacher(TeacherQuery teacherQuery) {
        log.debug("查询所有讲师列表:{}", teacherQuery);
        List<TeacherVO> teachername = teacherMapper.selectTeacher(teacherQuery);
        return teachername;
    }

    @Override
    public List<TeacherVO> selectTeacherAll(TeacherParam teacherAll) {
        log.debug("查询所有讲师详情:{}", teacherAll);
        List<TeacherVO> teacherall = teacherMapper.selectTeacherAll(teacherAll);
        return teacherall;
    }


    @Autowired
    TeacherRepository teacherRepository;

    @Override
    public List<TeacherVO> getTeacherList() {
        log.debug("获取讲师列表Service");
        return teacherRepository.getTeacherList();
    }

    @Override
    public TeacherVO getTeacherDetail(Integer id) {
        log.debug("获取讲师详情Service");
        return teacherRepository.getTeacherDetail(id);
    }
}
